package jmine.tec.web.wicket.testApp;

import images.ImageResources;
import jmine.tec.web.wicket.pages.main.Home;
import jmine.tec.web.wicket.security.SecureSession;

import org.apache.wicket.Page;
import org.apache.wicket.Request;
import org.apache.wicket.Response;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;

/**
 * @author takeshi.fukushima
 */
public class WicketTestApplication extends WebApplication {

    /**
     * {@inheritDoc}
     */
    @Override
    public Class<? extends Page> getHomePage() {
        return Home.class;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Session newSession(Request request, Response response) {
        return new SecureSession(request);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void init() {
        super.init();
        this.addComponentInstantiationListener(new SpringComponentInjector(this));
        this.getSharedResources().putClassAlias(ImageResources.class, "images");
    }

}
